<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>AR 体验</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
    <link rel="stylesheet" href="styles.css">
    <style>
        .ar-container {
            position: relative;
            height: calc(100vh - 56px);
            overflow: hidden;
            background-color: #000;
        }
        .ar-viewport {
            width: 100%;
            height: 100%;
            position: relative;
            background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1500"%3E%3Crect width="1000" height="1500" fill="%23333333"/%3E%3Cpath d="M100,600 L300,450 L500,550 L700,400 L900,500 L900,1200 L100,1200 Z" fill="%23555555"/%3E%3Cpath d="M300,450 L330,400 L360,460 L390,420 L420,470 L450,430 L480,480 L500,550" fill="none" stroke="%23777777" stroke-width="5"/%3E%3Cpath d="M400,900 C500,800 600,1000 700,900" stroke="%23999999" stroke-width="8" stroke-linecap="round"/%3E%3C/svg%3E');
            background-size: cover;
            background-position: center;
        }
        .ar-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
        }
        .ui-elements {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
        }
        .ui-element {
            pointer-events: auto;
        }
        .ar-top-bar {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            padding: 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .ar-close {
            width: 36px;
            height: 36px;
            border-radius: 18px;
            background-color: rgba(0, 0, 0, 0.6);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
        }
        .ar-info {
            display: flex;
            align-items: center;
            background-color: rgba(0, 0, 0, 0.6);
            color: white;
            padding: 6px 12px;
            border-radius: 18px;
            font-size: 14px;
        }
        .ar-info i {
            margin-right: 6px;
        }
        .ar-bottom-controls {
            position: absolute;
            bottom: 20px;
            left: 0;
            right: 0;
            display: flex;
            justify-content: center;
            gap: 20px;
            padding: 0 16px;
        }
        .ar-button {
            width: 60px;
            height: 60px;
            border-radius: 30px;
            background-color: rgba(255, 255, 255, 0.2);
            backdrop-filter: blur(5px);
            -webkit-backdrop-filter: blur(5px);
            border: 1px solid rgba(255, 255, 255, 0.3);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
        }
        .ar-capture {
            width: 70px;
            height: 70px;
            border-radius: 35px;
            background-color: rgba(255, 255, 255, 0.8);
            border: 3px solid white;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .ar-capture-inner {
            width: 54px;
            height: 54px;
            border-radius: 27px;
            background-color: white;
        }
        .ar-modes {
            position: absolute;
            bottom: 100px;
            left: 0;
            right: 0;
            display: flex;
            justify-content: center;
            gap: 12px;
            padding: 0 16px;
        }
        .ar-mode {
            background-color: rgba(0, 0, 0, 0.6);
            color: white;
            padding: 8px 16px;
            border-radius: 20px;
            font-size: 14px;
            display: flex;
            align-items: center;
        }
        .ar-mode.active {
            background-color: rgba(76, 175, 80, 0.8);
        }
        .ar-mode i {
            margin-right: 6px;
        }
        .ar-indicator {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 80px;
            height: 80px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .scan-area {
            width: 200px;
            height: 200px;
            border: 2px solid rgba(255, 255, 255, 0.5);
            border-radius: 10px;
            position: relative;
        }
        .scan-area::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 2px;
            background-color: #4CAF50;
            animation: scan 2s linear infinite;
        }
        @keyframes scan {
            0% { top: 0; }
            50% { top: calc(100% - 2px); }
            100% { top: 0; }
        }
        .scan-corners {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
        }
        .scan-corner {
            position: absolute;
            width: 20px;
            height: 20px;
            border-color: rgba(255, 255, 255, 0.8);
        }
        .corner-top-left {
            top: -2px;
            left: -2px;
            border-top: 2px solid;
            border-left: 2px solid;
        }
        .corner-top-right {
            top: -2px;
            right: -2px;
            border-top: 2px solid;
            border-right: 2px solid;
        }
        .corner-bottom-left {
            bottom: -2px;
            left: -2px;
            border-bottom: 2px solid;
            border-left: 2px solid;
        }
        .corner-bottom-right {
            bottom: -2px;
            right: -2px;
            border-bottom: 2px solid;
            border-right: 2px solid;
        }
        .ar-tooltip {
            position: absolute;
            background-color: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 8px 12px;
            border-radius: 6px;
            font-size: 12px;
            max-width: 200px;
            z-index: 10;
        }
        .ar-tooltip::after {
            content: '';
            position: absolute;
            bottom: -6px;
            left: 50%;
            transform: translateX(-50%);
            width: 0;
            height: 0;
            border-left: 6px solid transparent;
            border-right: 6px solid transparent;
            border-top: 6px solid rgba(0, 0, 0, 0.7);
        }
        .ar-hotspot {
            position: absolute;
            width: 30px;
            height: 30px;
            border-radius: 50%;
            background-color: rgba(76, 175, 80, 0.6);
            border: 2px solid white;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            animation: pulse 2s infinite;
            cursor: pointer;
        }
        .ar-hotspot.spirit {
            background-color: rgba(255, 193, 7, 0.6);
        }
        .ar-hotspot.info {
            background-color: rgba(33, 150, 243, 0.6);
        }
        .ar-spirit {
            position: absolute;
            width: 80px;
            height: 80px;
            animation: float 3s ease-in-out infinite;
        }
        .spirit-image {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            object-fit: cover;
            box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
        }
        .spirit-name {
            text-align: center;
            color: white;
            font-size: 12px;
            margin-top: 6px;
            text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
            font-weight: bold;
        }
        @keyframes float {
            0% { transform: translateY(0); }
            50% { transform: translateY(-10px); }
            100% { transform: translateY(0); }
        }
        .modal {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background-color: rgba(0, 0, 0, 0.8);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            padding: 20px;
            border-radius: 12px;
            width: 80%;
            max-width: 320px;
            color: white;
            z-index: 100;
            display: none;
        }
        .modal.active {
            display: block;
        }
        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 16px;
        }
        .modal-title {
            font-weight: bold;
            font-size: 18px;
        }
        .modal-close {
            color: #ccc;
            width: 24px;
            height: 24px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .modal-content {
            margin-bottom: 16px;
        }
        .modal-action {
            background-color: #4CAF50;
            color: white;
            border: none;
            padding: 10px;
            border-radius: 6px;
            width: 100%;
            font-weight: bold;
        }
        .ar-side-menu {
            position: absolute;
            top: 60px;
            right: 16px;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        .menu-item {
            width: 50px;
            height: 50px;
            border-radius: 25px;
            background-color: rgba(0, 0, 0, 0.6);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
        }
        .menu-item.active {
            background-color: rgba(76, 175, 80, 0.8);
        }
    </style>
</head>
<body>
    <div class="app-header">
        <div class="header-title">AR 体验</div>
        <div class="header-actions">
            <i class="fas fa-info-circle"></i>
        </div>
    </div>

    <div class="ar-container">
        <div class="ar-viewport">
            <!-- AR视图内容 - 使用背景图片模拟相机预览 -->
        </div>
        
        <div class="ar-overlay">
            <!-- UI 元素 -->
            <div class="ui-elements">
                <!-- 顶部工具栏 -->
                <div class="ar-top-bar">
                    <div class="ar-close ui-element">
                        <i class="fas fa-times"></i>
                    </div>
                    <div class="ar-info ui-element">
                        <i class="fas fa-map-marker-alt"></i>
                        <span>天门山景区</span>
                    </div>
                </div>
                
                <!-- 侧边功能菜单 -->
                <div class="ar-side-menu">
                    <div class="menu-item ui-element active">
                        <i class="fas fa-dragon"></i>
                    </div>
                    <div class="menu-item ui-element">
                        <i class="fas fa-info-circle"></i>
                    </div>
                    <div class="menu-item ui-element">
                        <i class="fas fa-history"></i>
                    </div>
                    <div class="menu-item ui-element">
                        <i class="fas fa-image"></i>
                    </div>
                </div>
                
                <!-- AR扫描框指示 - 在使用时会显示 -->
                <div class="ar-indicator" style="display: none;">
                    <div class="scan-area">
                        <div class="scan-corners">
                            <div class="scan-corner corner-top-left"></div>
                            <div class="scan-corner corner-top-right"></div>
                            <div class="scan-corner corner-bottom-left"></div>
                            <div class="scan-corner corner-bottom-right"></div>
                        </div>
                    </div>
                </div>
                
                <!-- AR模式选择 -->
                <div class="ar-modes">
                    <div class="ar-mode active ui-element">
                        <i class="fas fa-dragon"></i>
                        <span>精灵</span>
                    </div>
                    <div class="ar-mode ui-element">
                        <i class="fas fa-info-circle"></i>
                        <span>信息</span>
                    </div>
                    <div class="ar-mode ui-element">
                        <i class="fas fa-clock"></i>
                        <span>历史</span>
                    </div>
                </div>
                
                <!-- 底部控制按钮 -->
                <div class="ar-bottom-controls">
                    <div class="ar-button ui-element">
                        <i class="fas fa-camera-retro"></i>
                    </div>
                    <div class="ar-capture ui-element">
                        <div class="ar-capture-inner"></div>
                    </div>
                    <div class="ar-button ui-element">
                        <i class="fas fa-cog"></i>
                    </div>
                </div>
            </div>
            
            <!-- AR交互点 -->
            <div class="ar-hotspot spirit" style="top: 30%; left: 25%;">
                <i class="fas fa-dragon"></i>
            </div>
            <div class="ar-tooltip" style="top: 25%; left: 25%;">
                发现精灵：云灵
            </div>
            
            <div class="ar-hotspot info" style="top: 60%; left: 40%;">
                <i class="fas fa-info"></i>
            </div>
            
            <div class="ar-hotspot" style="top: 40%; left: 70%;">
                <i class="fas fa-mountain"></i>
            </div>
            
            <!-- AR精灵显示 -->
            <div class="ar-spirit" style="top: 35%; left: 60%;">
                <img class="spirit-image" src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='50' fill='%234CAF50'/%3E%3Cpath d='M30,30 L70,70 M70,30 L30,70' stroke='white' stroke-width='5'/%3E%3C/svg%3E" alt="云灵">
                <div class="spirit-name">云灵</div>
            </div>
            
            <!-- 弹出窗口 -->
            <div class="modal">
                <div class="modal-header">
                    <div class="modal-title">云灵 - 天门云使</div>
                    <div class="modal-close ui-element">
                        <i class="fas fa-times"></i>
                    </div>
                </div>
                <div class="modal-content">
                    <p>您发现了云灵！她是天门山的守护精灵，可以为您讲述天门山的历史与传说。</p>
                    <p>您还可以通过她查询景区信息、天气变化及周边服务。</p>
                </div>
                <button class="modal-action ui-element">开始对话</button>
            </div>
        </div>
    </div>
</body>
</html> 